package com.execjar.utils;

/**
 * @author zhuzi
 * 2024/12/18 22:7
 */


public class SqException extends RuntimeException {

    private Integer code;

    private String msg;

    public SqException(Integer code, String msg) {
        this.msg = msg;
        this.code = code;
    }

    public SqException(String msg) {
        this.msg = msg;
        this.code = ConstantCode.ERROR.getCode();
    }

    public SqException(String msg, Throwable t) {
        super(t);
        this.msg = msg;
        this.code = ConstantCode.ERROR.getCode();
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public void setCode(final Integer code) {
        this.code = code;
    }

    public void setMsg(final String msg) {
        this.msg = msg;
    }


    public String toString() {
        return "SqException(code=" + this.getCode() + ", msg=" + this.getMsg() + ")";
    }
}
